import { defineStore } from 'pinia'

// 第一个参数
const useUserStore = defineStore('user', {
  state: () => {
    return {
      username:'',
      userType:'',
      user_id:''
    }
  },
  actions: {
    changeState(params){
      this.username = params.username
      this.userType = params.userType 
      this.user_id = params.user_id
    },
  },
  persist: {
    enabled: true, // 开启数据缓存
  }
})

export { useUserStore }